var path = require('path')
var htmlWebpackPlugin = require('html-webpack-plugin')
const VueLoaderPlugin = require('vue-loader/lib/plugin')



module.exports = {
    entry: path.join(__dirname, './src/main.js'),
    output: {
        path: path.join(__dirname, './dist'),
        filename: 'bundel.js'
    },
    // build: {
    //     index: path.resolve(__dirname, "../dist/index.html"),
    //     assetsRoot: path.resolve(__dirname, "../dist"),
    //     assetSubDirectory: "static",
    //     assetsPuplicPath: "/",
    //     productionSourceMap: false,
    //     productionGzip: false,
    //     productionGzipExtensions: ["js", "css"]
    // },
    plugins: [
        new htmlWebpackPlugin({
            template: path.join(__dirname, './src/index.html'),
            filename: 'index.html'
        }),
        new VueLoaderPlugin()
    ], //所有webpack插件的配置节点
    module: {
        rules: [{
            test: /\.css$/,
            use: ['style-loader', 'css-loader']
        },
        {
            test: /\.less$/,
            use: ['style-loader', 'css-loader', 'less-loader']
        },
        {
            test: /\.scss$/,
            use: ['style-loader', 'css-loader', 'sass-loader']
        },
        {
            test: /\.jpg$/,
            use: ['url-loader?limit=5036', 'file-loader']
        },
        {
            test: /\.vue$/,
            use: 'vue-loader'
        },
        {
            test: /\.(eot|svg|ttf|woff|woff2)$/,
            loader: 'file-loader'
        }
        ]
    },
}
